package com.itcast.Web;

import com.itcast.Dao.PublicDao;
import com.itcast.Service.PublicService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App2 {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        PublicDao publicDao = (PublicDao) ctx.getBean("publicDao");
        PublicDao publicDao1 = (PublicDao) ctx.getBean("publicDao");
        System.out.println(publicDao);
        System.out.println(publicDao1);
//        PublicService publicService = (PublicService) ctx.getBean("publicService2");
//        PublicService publicService1 = (PublicService) ctx.getBean("publicService");
//        System.out.println(publicService1);
//        System.out.println(publicService);
    }
}
